% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fixnames.R
\name{fixnames}
\alias{fixnames}
\title{like fixcolnames(), a helper function to rename variables that are colnames of data.frame}
\usage{
fixnames(namesnow, oldtype = "api", newtype = "r", mapping_for_names)
}
\arguments{
\item{namesnow}{vector of colnames (but can be a data.frame or data.table too)}

\item{oldtype}{friendly or long or original, or csv or r or api}

\item{newtype}{friendly or long or original, or csv or r or api}

\item{mapping_for_names}{data.frame passed to \code{\link[=fixnames]{fixnames()}} to do the work.}
}
\value{
Vector or new column names same length as input.
The function does NOT return an entire renamed df or dt. Just the new colnames are returned.
}
\description{
Changes column names to R variable names from original API names in FTP site file
}
\details{
YOU CAN SPECIFY A TYPE USING AN ALIAS LIKE
"api" or "long" UNLIKE IN \code{\link[=fixnames_to_type]{fixnames_to_type()}} where
you had to specify the actual colnames of map_headernames, like "apiname"

NOTE: If you happen to pass the entire data.frame or data.table to this function,
instead of passing just the colnames, this function will see that and still
return just a vector of new colnames
}
\seealso{
\code{\link[=varinfo]{varinfo()}}  \code{\link[=fixnames_to_type]{fixnames_to_type()}} \code{\link[=fixcolnames]{fixcolnames()}} \code{\link[=fixnames]{fixnames()}}
}
\keyword{internal}
